<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org" >
<head>
    <title>通用网关服务</title>
    <meta charset="UTF-8">
    <link rel="stylesheet" type="text/css" th:href="@{/Css/bootstrap.css}" />
    <link rel="stylesheet" type="text/css" th:href="@{/Css/bootstrap-responsive.css}" />
    <link rel="stylesheet" type="text/css" th:href="@{/Css/style.css}" />
    <script type="text/javascript" th:src="@{/Js/jquery.js}"></script>
    <script type="text/javascript" th:src="@{/Js/jquery.sorted.js}"></script>
    <script type="text/javascript" th:src="@{/Js/bootstrap.js}"></script>
    <script type="text/javascript" th:src="@{/Js/ckform.js}"></script>
    <script type="text/javascript" th:src="@{/Js/common.js}"></script>
    <style type="text/css">
        body {
            padding-bottom: 40px;
        }
        .sidebar-nav {
            padding: 9px 0;
        }

        @media (max-width: 980px) {
            /* Enable use of floated navbar text */
            .navbar-text.pull-right {
                float: none;
                padding-left: 5px;
                padding-right: 5px;
            }
        }
    </style>
</head>
<body>
<form class="form-inline definewidth m20" th:action="@{/Node/query}" method="get">  
         网关名称：
    <input type="text" name="name" id="name"class="abc input-default" placeholder="网关名称" value="">&nbsp;&nbsp;  
    <input type="text" name="path" id="path"class="abc input-default" placeholder="拦截Path" value="">&nbsp;&nbsp;  
    <input type="text" name="serviceId" id="serviceId"class="abc input-default" placeholder="服务ID" value="">&nbsp;&nbsp;
    <a id="addNewPage" class="btn btn-success" th:href="@{/Node/add}">新增路由</a>
    <a id="refresh" class="btn btn-success" th:href="@{/Node/refresh}">刷新路由</a>
    <button type="submit" class="btn btn-primary">查询</button>&nbsp;&nbsp;<!-- <button type="button" class="btn btn-success" th:onclick="javascript:window.location.href=@{/Node/add}" id="addnew">新增路由</button> -->
</form>
<table class="table table-bordered table-hover definewidth m10" >
    <thead>
    <tr>
        <th>网关名称</th>
        <th>拦截Path</th>
        <th>服务ID</th>
        <th>转发URL</th>
       <!--  <th>限流速度</th>
        <th>限流容量</th> 
        <th>优先级</th>
        <th>状态</th>-->
        <th colspan="2">操作</th>
    </tr>
    </thead>
	     <tr th:each="gatewayObj:${data}">
            <td th:text="${gatewayObj.name}"></td>
            <td th:text="'http:/' + ${ip} +':'+ ${port} + ${gatewayObj.path}"></td>
            <td th:text="${gatewayObj.serviceId}"></td>
            <td th:text="${gatewayObj.url}"></td>
<!--             <td th:text="${gatewayObj.limitRate}"></td>
            <td th:text="${gatewayObj.limitCapacity}"></td> -->
<!--             <td th:text="${gatewayObj.routeOrder}"></td>
            <td th:text="${gatewayObj.status}"></td> -->
            <td>
            	<a th:href="@{/Node/edit/(id=${gatewayObj.id})}">编辑</a>
            </td>
            <td>
            	<a th:href="@{/Node/remove/(id=${gatewayObj.id})}">删除</a>
            </td>
        </tr>
    </table>
	<div class="inline pull-right page">
         10122 条记录 1/507 页  <a href='#'>下一页</a>
	<span class='current'>1</span><a href='#'>2</a><a th:href='@{/chinapost/index.php?m=Label&a=index&p=3}'>3</a><a href='#'>4</a><a href='#'>5</a>  <a href='#' >下5页</a> <a href='#' >最后一页</a>    </div>
</body>
</html>
<script>
   /*  $(function () {
		$('#addnew').click(function(){
			/* window.location.href="Node/add"; */
			$('#addNewPage').click();
			alert(1);
		 });
    }); */

	function del(id)
	{
		if(confirm("确定要删除吗？"))
		{
		
			var url = "index.html";
			
			window.location.href=url;		
		
		}
	}
</script>